/**
 * Description:
 * Class Name:NonAnonymousTest
 * Date:2022/2/11 13:52
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第6章_面向对象_下._6_7_内部类._6_7_5_匿名内部类;

interface Product2{
    double getPrice();
    String getName();
}

public class NonAnonymousTest implements Product2{
    public double getPrice(){
        return 567.8;
    }
    public String getName(){
        return "AGP显卡";
    }
    public void test(Product2 p){
        System.out.println("购买了一个" + p.getName() + "，花费了" + p.getPrice());
    }

    public static void main(String[] args) {
        var ta = new NonAnonymousTest();
        ta.test(ta);
    }
}
